home *** CD-ROM | disk | FTP | other *** search
/ Singles Flirt Up Your Life! (German) / Singles Flirt Up Your Life.iso / data1.cab / Statemachine / questErotic9.lua < prev    next >
Text File  |  2004-01-29  |  2KB  |  81 lines

  1. beginStateMachine()
  2.  
  3.     -- called when questor builds up all known questScripts
  4.     onEnter(function(msg)
  5.         print("questErotic9 entered");
  6.         setState("initial");
  7.     end )
  8.     
  9.     -- on game over: relationship conditions get reset to 0 and all quests are reset to initial
  10.     onMsg("questreset", function(msg)
  11.         setState("initial");
  12.     end ) 
  13.     
  14.     onDefault( function(msg) 
  15.         --print("################## questErotic9-State: ".. getState());
  16.         --setState("initial");
  17.     end )
  18. ---------------------------------------------------------------------------------------------------------------------------------------    
  19.     
  20.     state("initial") 
  21.         onMsg("checkCondition", function(msg)
  22.             local mike = getParent().getParent().getCharacter(MIKE);
  23.             local elaine = getParent().getParent().getCharacter(ELAINE);
  24.  
  25.             if ( -- condition here
  26.         ----------------
  27.                 min(    mike.getRelationshipCondition(ELAINE, REL_EROTIC),
  28.                     elaine.getRelationshipCondition(MIKE, REL_EROTIC) ) >= 9
  29.                         and 
  30.                 mike.getObjectsWithBehavior("doublebed")[1]
  31.                 )
  32.         ----------------
  33.             then
  34.                 -- go to talk position
  35.                 --mike.cancelCurrentActivity();
  36.                 
  37.                 elaine.queueCommand("pm_talkCutscene", "talkCutscene", mike, "questErotic9");
  38.                 mike.queueCommand("pm_holdBehind", "holdBehind", elaine, "");
  39.                 
  40.                 sendDelayedMsgThis("holding", 3000, "");
  41.                 setState("talktome");
  42.             end
  43.         end )
  44.         
  45.         
  46.     state("talktome")
  47.         ----------------        
  48.         onMsg("talking", function(msg)
  49.             if (msg.data == "questErotic9") then
  50.                 popupConversation("dialogErotic9");
  51.                 setState("donetalktome");
  52.             end 
  53.         end )
  54.     
  55.     state("donetalktome")
  56.         onMsg("yes", function(msg)
  57.             local mike = getParent().getParent().getCharacter(MIKE);
  58.             local elaine = getParent().getParent().getCharacter(ELAINE);
  59.             
  60.             mike.cancelCurrentActivity();
  61.             elaine.cancelCurrentActivity();
  62.             
  63.             elaine.queueCommand("pm_getIntimateBed", "getIntimateBed", mike, "");
  64.             
  65.             setState("done");
  66.         end )
  67. ---------------------------------------------------------------------------------------------------------------------------------------    
  68.  
  69.         
  70.     state("done")
  71.     
  72.     -- sackgasse hier
  73.         
  74.         
  75.         
  76. endStateMachine()
  77.  
  78.  
  79.  
  80.  
  81.